package com.seal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.seal.comm.utils.Page;
import com.seal.dao.IMemberInfoDao;
import com.seal.dto.MemberInfoDto;
import com.seal.model.MemberInfo;
import com.seal.service.IMemberInfoService;

@Service("memberInfoServiceImpl")
@Transactional(readOnly = true)
public class MemberInfoServiceImpl implements IMemberInfoService{
	@Resource(name= "memberInfoDaoImpl")
	private IMemberInfoDao memberInfoDao;

	@Transactional(readOnly = false,rollbackForClassName="Exception")
	public void addMemberInfo(MemberInfo ca) throws Exception {
		memberInfoDao.addMemberInfo(ca);
	}

	@Transactional(readOnly = false,rollbackForClassName="Exception")
	public void deleteMemberInfo(MemberInfo ca) throws Exception {
		memberInfoDao.deleteMemberInfo(ca);
	}

	public List<MemberInfo> getAllMemberInfo(MemberInfoDto memberDto, Page page) throws Exception {
		return memberInfoDao.getAllMemberInfo(memberDto, page);
	}

	public MemberInfo getMemberInfoById(Long id) throws Exception {
		return memberInfoDao.getMemberInfoById(id);
	}

	@Transactional(readOnly = false,rollbackForClassName="Exception")
	public void updateMemberInfo(MemberInfo ca) throws Exception {
		memberInfoDao.updateMemberInfo(ca);
	}

	public int getAllMemberInfoCount(String userId) throws Exception {
		return memberInfoDao.getAllMemberInfoCount(userId);
	}
	
	public int getNotInGroupMemberInfoCount(String userId) throws Exception {
		return memberInfoDao.getNotInGroupMemberInfoCount(userId);
	}

	public List<MemberInfo> getNotInGroupMemberInfo(String userId, Page page) throws Exception {
		return memberInfoDao.getNotInGroupMemberInfo(userId, page);
	}
	
	
}
